

package TransportesMarroquin;

import java.awt.Graphics; 
import java.awt.Image;
import java.awt.Toolkit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;

public class InterLoad extends javax.swing.JPanel {
    
   Image im;
   int i=0;
   Graphics gio;
   Image img;
   Inicio va;
   boolean start=false;
      
   
   public InterLoad() {
             initComponents();
       
            
     
  new cronometro();
    }

    @Override
   public void paintComponent (Graphics gio){
       super.paintComponent(gio);
       im=Toolkit.getDefaultToolkit().getImage(System.getProperty("user.dir")+"\\src\\Imagenes\\bulb0.png");
     
        
          img=Toolkit.getDefaultToolkit().getImage(System.getProperty("user.dir")+"\\src\\Imagenes\\bulb.gif");
          gio.drawImage(im, 0, 0, this);  
           gio.drawImage(img, 0, 0, this);  
                     
     
   }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                formKeyPressed(evt);
            }
            public void keyReleased(java.awt.event.KeyEvent evt) {
                formKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 379, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 522, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


 public class cronometro implements Runnable{

 Thread crono;

/** Creates new form cronometro */
public cronometro() {

crono = new Thread(this);
crono.start();
}

public void run()
{
  
     
            try {
            //7200
                    crono.sleep(7400);
                    repaint();
                       va = new Inicio();
                       va.setExtendedState(6);
                       va.setVisible(true);                      
                       va.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                       main.va.dispose();
     
                 
                   
               
            } catch (InterruptedException ex) {
                Logger.getLogger(InterLoad.class.getName()).log(Level.SEVERE, null, ex);
            }

              }
 
 }
    private void formKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyPressed
    
          
    }//GEN-LAST:event_formKeyPressed

    private void formKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_formKeyReleased
      
    }//GEN-LAST:event_formKeyReleased


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

    


}
